// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { NamedFC } from 'common/react/named-fc';
import { adaLaptop } from 'icons/ada/ada-laptop-base64';
import { adaMulticolorBubbles } from 'icons/ada/ada-multicolor-bubbles-base64';
import { sleepingAda } from 'icons/ada/sleeping-ada-base64';
import { blue48 } from 'icons/brand/blue/brand-blue-48px-base64';
import * as React from 'react';
import { DictionaryNumberTo } from 'types/common-types';

export enum InlineImageType {
    InsightsLogo48,
    AdaTheCat,
    FailIcon,
    PassIcon,
    NotApplicableIcon,
    AdaLaptop,
    SleepingAda,
}

export interface InlineImageProps {
    imageType: InlineImageType;
    alt: string;
    className?: string;
}

const inlineImageTypeToData: DictionaryNumberTo<string> = {
    [InlineImageType.AdaTheCat]: adaMulticolorBubbles,
    [InlineImageType.AdaLaptop]: adaLaptop,
    [InlineImageType.SleepingAda]: sleepingAda,
    [InlineImageType.InsightsLogo48]: blue48,
    [InlineImageType.FailIcon]:
        '',
    [InlineImageType.PassIcon]:
        '',
    [InlineImageType.NotApplicableIcon]:
        '',
};

export const InlineImage = NamedFC<InlineImageProps>(
    'InlineImage',
    ({ imageType, alt, className }) => {
        const imageData = inlineImageTypeToData[imageType];
        if (imageData === undefined) {
            return null;
        }

        return <img className={className} src={imageData} alt={alt} />;
    },
);
